<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/jsplib/pubhead.jsp"%>
<%@ page import="net.comm.common.ValueMaping" %>
<%@ taglib uri="/WEB-INF/myTaglib.tld" prefix="tag"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>日志管理</title>
	<link href="${cpath}/css/youlin.css" rel="stylesheet" type="text/css" media="all" />
	<script type="text/javascript" src="${cpath}/fckeditor/fckeditor.js"></script>
	<SCRIPT src="${cpath}/js/glk_array.js" type=text/javascript></SCRIPT>
	<SCRIPT src="${cpath}/js/glr_array.js" type=text/javascript></SCRIPT>
	<SCRIPT src="${cpath}/js/glfun.js"	   type=text/javascript></SCRIPT>
</head>
<body>
<!--外套 start -->
<div class="wrap">
  <!--页首 start -->
	<%@ include file="/menu.jsp"%>
  <!--页首 end -->  
  
  <!--导航面包屑 start -->
  <div class="breadCrumb">
  <div class="breadCrumbNav">当前位置：<a href="${cpath}/users.do?action=main">我的主页</a> >> 日志管理</div>
	<%@ include file="/navf.jsp"%> 
 </div> 
  <!--导航面包屑 end -->
  
  <!--主体 start -->
 <div class="body">
 
  <div class="hotBox1">  
    <div class="hotBox1-left">
      <img src="${cpath}/images/rich_text_format.png"  width="75" height="75"  class="shequ icon user_icon_2">
      <p class="nav">&nbsp;我的日志</p>
    </div>
    <div class="hotBox1-right">
      <p><a href="javascript:history.go(-1);"><img src="${cpath}/images/icon_32.gif" width="137" height="25" /></a></p>
      <p>&nbsp;</p>    
    </div>
  </div> 
  
 <div class="left-Box6">
	<h3 class="nav"><a >日志管理</a></h3>

  <div class="left-Box6-content">
   <div class="left-Box6-content-inner">   
	<form action="${cpath}/blog.do" name="theForm"  method="post" enctype="multipart/form-data" class="frmAddTopic" >
       <p>
       <label>标 题</label>
       <input type="text" name='title' value='${theForm.title}' maxlength="100" />&nbsp;<tag:ARRAY  id="blogSet" name="blogSet" options="<%=ValueMaping.USERSET_TYPE%>" value='${theForm.blogSet}'  />
       </p>
       <p>
       <label>内 容</label>
       <label>
          <textarea name="fck" rows="8" cols="40" >${theForm.content}</textarea>
       </label>
       </p>
       <p><label>关键词</label>
       <input type="text" name='tags' value='${theForm.tags}' maxlength=300 class="long"/>&nbsp;多个关键词以逗号分隔
       </p>
       <p class="btn">
       <a href="javascript:doConfirm();"><img src="${cpath}/images/icon_09.gif" /></a> 
       <a href="javascript:history.go(-1);"><img src="${cpath}/images/icon_33.gif" /></a>
       </p>
						<!--隐藏域-->
						<input type="hidden" name='blogID'		value='${theForm.blogID}'/>
						<input type="hidden" name='follID'		value='${theForm.follID}'/>
						<input type="hidden" name='upFollID'	value='${theForm.upFollID}'/>
						<input type="hidden" name='userID'		value='${theForm.userID}'/>
						<input type="hidden" name='intro'		value='${theForm.intro}'/>
						<input type="hidden" name='content'		value=''/>
						<input type="hidden" name='f_ID'		value='${theForm.f_ID}'/>
						<input type="hidden" name='firsort'		value='${theForm.firsort}'/>
						<input type="hidden" name='secsort'		value='${theForm.secsort}'/>
						<input type="hidden" name='thisort'		value='${theForm.thisort}'/>
						<input type="hidden" name='status'		value='${theForm.status}'/>
						<input type="hidden" name='attachNum'	value='${theForm.attachNum}'/>
						<input type="hidden" name='replyNum'	value='${theForm.replyNum}'/>
						<input type="hidden" name='pubTime'		value='${theForm.pubTime}'/>
						<input type="hidden" name='upUserID'	value='${theForm.upUserID}'/>
						<input type="hidden" name='action'		value='${theForm.action}'/>
     </form>
      </div>
   <div class="clearFloat"></div>
  </div>
</div>
  
    <div class="clearFloat"></div>
 </div> 
 <!--主体 end -->
 
 
 <!--页脚 start -->
	<%@ include file="/foot.jsp"%>
 <!--页脚 end --> 
</div>
<!--外套 end -->

</body>
</html>
<!---->
<script type="text/javascript">
  var oFCKeditor = new FCKeditor('fck');	//传入参数为表单元素（由FCKeditor生成的input或textarea）的name
      oFCKeditor.BasePath='${cpath}/fckeditor/';//指定FCKeditor根路径，也就是fckeditor.js所在的路径
      oFCKeditor.Height='270px';
      oFCKeditor.Width='650px';
      oFCKeditor.ToolbarSet='Demo';				//指定工具栏
	  oFCKeditor.ReplaceTextarea();
</script>
<script>
    /**
     * 检查项目资料维护
     */
	function doConfirm()
	{
		var form = document.theForm;

		var action = form['action'];
		var title = form['title'];
		var content = form['content'];
		var fck = FCKeditorAPI.GetInstance("fck").GetXHTML("true");   

		if(title.value == null||title.value.replace(/(^\s*)|(\s*$)/g,"").length < 1)
  		{
			alert('标题不能为空');
			title.select();
			return ;
		}
		var firsort = form['firsort'];
		if(firsort.value == "")
  		{
			alert('请选择分类');
			firsort.select();
			return ;
		}

//		content.value = gjcfilter(fck);
		content.value = fck;
		if(content.length > 30000)
		{
			alert('内容长度不能大于30000,当前长度：' + content.length);
			return ;
		}
		form.submit();
	}

  /**
   * 根据具体请求设置各个组件状态	
   */
  function showState()
  {
		var action = '${theForm.action}';
		var form = document.theForm;		
		if(action == 'detail')
		{
           
			document.getElementById("back").style.display = "none";
		}
		else if(action == 'modifyPage' || action == 'update')
		{

			form['action'].value = 'update';
		}else{

			form['action'].value = 'add';
		}

	}
	showState();

</script>
